Skip to content

Allow building in free-threaded python#2286

Open
ricardoV94 wants to merge 1 commit into
pymc-devs:mainfrom
ricardoV94:free_threaded
Open

Allow building in free-threaded python#2286
ricardoV94 wants to merge 1 commit into
pymc-devs:mainfrom
ricardoV94:free_threaded

Conversation

@ricardoV94

@ricardoV94 ricardoV94 commented Jul 10, 2026

Copy link
Copy Markdown
Member

Now that C-backend is not the default, there's no good reason to prevent free-threaded builds.

Our C extensions are not thread-safe, but they don't claim to be, so if imported python will just re-enable the gil with a warning.

For users, care must be taken to split the memory and shared variables of a compiled function fn.copy(share_memory=False, swap={}) before threading, but that's not really new. See pymc-devs/pymc#8355 for an example

Also helped by #2285

@ricardoV94 ricardoV94 marked this pull request as draft July 10, 2026 13:38
@ricardoV94 ricardoV94 force-pushed the free_threaded branch 4 times, most recently from fbb512a to 48ae917 Compare July 10, 2026 15:18
@ricardoV94 ricardoV94 force-pushed the free_threaded branch 6 times, most recently from e16603d to cc3a8c0 Compare July 13, 2026 14:28
@ricardoV94 ricardoV94 requested a review from maresb July 14, 2026 08:01
@ricardoV94 ricardoV94 marked this pull request as ready for review July 14, 2026 08:01
@ricardoV94 ricardoV94 requested a review from lucianopaz July 14, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant